package string02;
/*
String 类面试题二
 */
public class Demo04 {
    public static void main(String[] args) {
        String str1 = "abc";
        String str2 = "def";
        String str3 = new String("abc");

        System.out.println(str1 == str3);//false
        System.out.println(str1.equals(str3));//true

        System.out.println(str2 == str3);//false  new出来的有地址值，和常量池不一样
        System.out.println(str2.equals(str3));//false

    }
}
